negotiator.utility
Class EvaluatorInteger

java.lang.Object
  extended by negotiator.utility.EvaluatorInteger
All Implemented Interfaces:
Evaluator

public class EvaluatorInteger
extends java.lang.Object
implements Evaluator

This class is used to convert the value of an integer issue to a utility. This object stores the range of the issue and a linear function mapping each value to a utility. Note that this utility is not yet normalized by the issue weight and is therefore in the range [0,1].

Author:
Wouter Pasman

Constructor Summary
EvaluatorInteger()
          Creates a new integer evaluator with weight 0 and no values.
 
Method Summary
 EvaluatorInteger clone()
           
 double getConstantParam()
          Deprecated. 
 java.lang.Double getEvaluation(int value)
           
 java.lang.Double getEvaluation(UtilitySpace uspace, Bid bid, int index)
          This method returns the utility of the value of an issue.
 EVALFUNCTYPE getFuncType()
           
 double getLinearParam()
          Deprecated. 
 int getLowerBound()
           
 double getOffset()
           
 double getSlope()
           
 EVALUATORTYPE getType()
           
 int getUpperBound()
           
 double getUtilHighestValue()
           
 double getUtilLowestValue()
           
 double getWeight()
           
 java.lang.String isComplete(Objective whichobj)
          Check whether the evaluator has enough information to make an evaluation.
 void loadFromXML(negotiator.xml.SimpleElement pRoot)
          Method to
 void lockWeight()
          Locks the weight of this Evaluator.
 void setConstantParam(double offset)
          Deprecated. 
 void setLinearFunction(double utilLowInt, double utilHighInt)
          Specifies the linear utility function of the issue by giving the utility of the lowest value and the highest value.
 void setLinearParam(double slope)
          Deprecated. 
 void setLowerBound(int lb)
          Sets the lower bound of this evaluator.
 void setOffset(double offset)
          Sets the offset of the linear utility function.
 void setSlope(double slope)
          Sets the slope of the linear utility function.
 void setUpperBound(int ub)
          Sets the upper bound of this evaluator.
 void setWeight(double wt)
          Sets the weigth with which an Objective or Issue is evaluated.
 negotiator.xml.SimpleElement setXML(negotiator.xml.SimpleElement evalObj)
          Sets weights and evaluator properties for the object in SimpleElement representation that is passed to it.
 void unlockWeight()
          Unlock the weight of this evaluator.
 boolean weightLocked()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EvaluatorInteger

public EvaluatorInteger()
Creates a new integer evaluator with weight 0 and no values.

Method Detail

getWeight

public double getWeight()
Specified by:
getWeight in interface Evaluator
Returns:
the weight associated with this

setWeight

public void setWeight(double wt)
Description copied from interface: Evaluator
Sets the weigth with which an Objective or Issue is evaluated.

Specified by:
setWeight in interface Evaluator
Parameters:
wt - The new weight.

lockWeight

public void lockWeight()
Locks the weight of this Evaluator.

Specified by:
lockWeight in interface Evaluator

unlockWeight

public void unlockWeight()
Unlock the weight of this evaluator.

Specified by:
unlockWeight in interface Evaluator

weightLocked

public boolean weightLocked()
Specified by:
weightLocked in interface Evaluator
Returns:
The state of the weightlock.

getEvaluation

public java.lang.Double getEvaluation(UtilitySpace uspace,
                                      Bid bid,
                                      int index)
Description copied from interface: Evaluator
This method returns the utility of the value of an issue. Note that the value is not multiplied by the issue weight, and is therefore non-normalized.

Specified by:
getEvaluation in interface Evaluator
Parameters:
uspace - preference profile
bid - in which the value is contained.
index - of the issue in the bid.
Returns:
utility of the value for an issue, not normalized by the issue weight.

getEvaluation

public java.lang.Double getEvaluation(int value)
Parameters:
value - of an issue.
Returns:
utility of the given value (range: [0,1]).

getType

public EVALUATORTYPE getType()
Specified by:
getType in interface Evaluator
Returns:
type of evaluation function, for example EVALUATORTYPE.LINEAR.

getFuncType

public EVALFUNCTYPE getFuncType()
Returns:
evaluation function type.

getLowerBound

public int getLowerBound()
Returns:
lowerbound of the integer issue.

getUpperBound

public int getUpperBound()
Returns:
higherbound of the integer issue.

getUtilLowestValue

public double getUtilLowestValue()
Returns:
lowest possible utility value.

getUtilHighestValue

public double getUtilHighestValue()
Returns:
highest possible utility value.

setLowerBound

public void setLowerBound(int lb)
Sets the lower bound of this evaluator.

Parameters:
lb - The new lower bound

setUpperBound

public void setUpperBound(int ub)
Sets the upper bound of this evaluator.

Parameters:
ub - The new upper bound

setLinearFunction

public void setLinearFunction(double utilLowInt,
                              double utilHighInt)
Specifies the linear utility function of the issue by giving the utility of the lowest value and the highest value.

Parameters:
utilLowInt - utility of the lowest vale.
utilHighInt - utility of the highest value.

loadFromXML

public void loadFromXML(negotiator.xml.SimpleElement pRoot)
Description copied from interface: Evaluator
Method to

Specified by:
loadFromXML in interface Evaluator

setXML

public negotiator.xml.SimpleElement setXML(negotiator.xml.SimpleElement evalObj)
Sets weights and evaluator properties for the object in SimpleElement representation that is passed to it.

Parameters:
evalObj - The object of which to set the evaluation properties.
Returns:
The modified simpleElement with all evaluator properties set.

isComplete

public java.lang.String isComplete(Objective whichobj)
Description copied from interface: Evaluator
Check whether the evaluator has enough information to make an evaluation.

Specified by:
isComplete in interface Evaluator
Parameters:
whichobj - is the objective/issue to which this evaluator is attached.
Returns:
String describing lacking component, or null if the evaluator is complete.

getSlope

public double getSlope()
Returns:
slope of the linear utility function.

getLinearParam

@Deprecated
public double getLinearParam()
Deprecated. 

Returns:
slope of the linear utility function.

setSlope

public void setSlope(double slope)
Sets the slope of the linear utility function.

Parameters:
slope - of the linear utility function.

setLinearParam

@Deprecated
public void setLinearParam(double slope)
Deprecated. 

Sets the slope of the linear utility function.

Parameters:
slope - of the linear utility function.

getOffset

public double getOffset()
Returns:
offset of the linear utility function.

getConstantParam

@Deprecated
public double getConstantParam()
Deprecated. 

Returns:
offset of the linear utility function.

setOffset

public void setOffset(double offset)
Sets the offset of the linear utility function.

Parameters:
offset - of the linear utility function.

setConstantParam

@Deprecated
public void setConstantParam(double offset)
Deprecated. 

Sets the offset of the linear utility function.

Parameters:
offset - of the linear utility function.

clone

public EvaluatorInteger clone()
Specified by:
clone in interface Evaluator
Overrides:
clone in class java.lang.Object
Returns:
clone of the current object.